class GroupApplyModel {
  String sId;
  String applierId;
  String groupId;
  String createdTime;
  String updatedTime;
  int status;
  Null note;
  String operatorId;
  UserInfo userInfo;

  GroupApplyModel(
      {this.sId,
      this.applierId,
      this.groupId,
      this.createdTime,
      this.updatedTime,
      this.status,
      this.note,
      this.operatorId,
      this.userInfo});

  GroupApplyModel.fromJson(Map<String, dynamic> json) {
    sId = json['_id'];
    applierId = json['applier_id'];
    groupId = json['group_id'];
    createdTime = json['created_time'];
    updatedTime = json['updated_time'];
    status = json['status'];
    note = json['note'];
    operatorId = json['operator_id'];
    userInfo = json['user_info'] != null
        ? new UserInfo.fromJson(json['user_info'])
        : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['_id'] = this.sId;
    data['applier_id'] = this.applierId;
    data['group_id'] = this.groupId;
    data['created_time'] = this.createdTime;
    data['updated_time'] = this.updatedTime;
    data['status'] = this.status;
    data['note'] = this.note;
    data['operator_id'] = this.operatorId;
    if (this.userInfo != null) {
      data['user_info'] = this.userInfo.toJson();
    }
    return data;
  }
}

class UserInfo {
  String avatar;
  String userId;
  String token;
  String phoneNumber;
  String nickname;
  String createdAt;
  String updatedAt;

  UserInfo(
      {this.avatar,
      this.userId,
      this.token,
      this.phoneNumber,
      this.nickname,
      this.createdAt,
      this.updatedAt});

  UserInfo.fromJson(Map<String, dynamic> json) {
    avatar = json['avatar'];
    userId = json['userId'];
    token = json['token'];
    phoneNumber = json['phoneNumber'];
    nickname = json['nickname'];
    createdAt = json['createdAt'];
    updatedAt = json['updatedAt'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['avatar'] = this.avatar;
    data['userId'] = this.userId;
    data['token'] = this.token;
    data['phoneNumber'] = this.phoneNumber;
    data['nickname'] = this.nickname;
    data['createdAt'] = this.createdAt;
    data['updatedAt'] = this.updatedAt;
    return data;
  }
}
